/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.hnilica.emailer;

import java.io.Serializable;

/**
 *
 * @author swosh
 */
public class EmailTermin implements Serializable, Comparable<EmailTermin> {

    private String email;
    private Termin termin;

    public EmailTermin() {
    }

    public EmailTermin(String email, Termin termin) {
        this.email = email;
        this.termin = termin;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Termin getTermin() {
        return termin;
    }

    public void setTermin(Termin termin) {
        this.termin = termin;
    }

    public int compareTo(EmailTermin o) {
        int result = this.getEmail().compareToIgnoreCase(o.getEmail());
        if (result > 0) {
            return 1;
        } else if (result < 0) {
            return -1;
        } else {
            result = (this.getTermin().compareTo(o.getTermin()));
            if (result > 0) {
                return 1;
            } else if (result < 0) {
                return -1;
            } else {
                return 0;
            }

        }


    }

}
